package shooter.network;

/**
 * Represents a message which carries the movements of a player.
 * 
 * @author Michail Tausch
 */
public class MovementMessage extends Message{
	
	boolean up;
	boolean down;
	boolean left;
	boolean right;
	boolean strafeRight;
	boolean strafeLeft;

	boolean shoot;
	boolean reload;
	
	int weaponMode = 1;
	
	int playerIndex = 0;
		
	/**
	 * The constructor.
	 * @param playerIndex
	 */
	public MovementMessage(int playerIndex){
		this.playerIndex=playerIndex;
	}
	
	/**
	 * Is the player moving up?
	 * @return
	 */
	public boolean isUp() {
		return up;
	}
	
	/**
	 * Sets the player up.
	 * @param up
	 */
	public void setUp(boolean up) {
		this.up = up;
	}

	/**
	 * Is the player moving down?
	 * @return
	 */
	public boolean isDown() {
		return down;
	}
	
	/**
	 * Sets the player down.
	 * @param down
	 */
	public void setDown(boolean down) {
		this.down = down;
	}

	/**
	 * Is the player rotating to the left?
	 * @return
	 */
	public boolean isLeft() {
		return left;
	}
	
	/**
	 * Sets the player rotating to the left.
	 * @param left
	 */
	public void setLeft(boolean left) {
		this.left = left;
	}
	
	/**
	 * Is the player rotating to the right?
	 * @return
	 */
	public boolean isRight() {
		return right;
	}
	
	/**
	 * Sets the player rotating to the right.
	 * @param right
	 */
	public void setRight(boolean right) {
		this.right = right;
	}

	/**
	 * Is the player strafing to the right?
	 * @return
	 */
	public boolean isStrafeRight() {
		return strafeRight;
	}
	
	/**
	 * Sets the player strafing to the right.
	 * @param strafeRight
	 */
	public void setStrafeRight(boolean strafeRight) {
		this.strafeRight = strafeRight;
	}
	
	/**
	 * Is the player strafing to the left?
	 * @return
	 */
	public boolean isStrafeLeft() {
		return strafeLeft;
	}
	
	/**
	 * Sets the player strafing to the left.
	 * @param strafeLeft
	 */
	public void setStrafeLeft(boolean strafeLeft) {
		this.strafeLeft = strafeLeft;
	}
	
	/**
	 * Is the player shooting?
	 * @return
	 */
	public boolean isShoot() {
		return shoot;
	}
	
	/**
	 * Sets the player shooting.
	 * @param shoot
	 */
	public void setShoot(boolean shoot) {
		this.shoot = shoot;
	}
	
	/**
	 * Returns the index of the player.
	 * @return
	 */
	public int getPlayerIndex() {
		return playerIndex;
	}

	/**
	 * Returns the current weapon number.
	 * @return
	 */
	public int getWeaponMode() {
		return weaponMode;
	}
	
	/**
	 * Sets the current weapon.
	 * @param weaponMode
	 */
	public void setWeaponMode(int weaponMode) {
		this.weaponMode = weaponMode;
	}

	/**
	 * Is the player reloading?
	 * @return
	 */
	public boolean isReload() {
		return reload;
	}

	/**
	 * Sets the player reloading.
	 * @param reload
	 */
	public void setReload(boolean reload) {
		this.reload = reload;
	}	
}
